package com.ssm.controller;


import com.ssm.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@Slf4j
public class DemoController {

    @Resource
    IUserService userService;

    @RequestMapping("/index")
    public String index(Model model) {
        log.info("index");
        log.debug("index");
        log.error("index");
        log.trace("index");
        log.warn("index");
        model.addAttribute("message", "Hello World");
        model.addAttribute("users", userService.getUsers());
        return "index";
    }
}
